/*************************************************************************
 * This file is part of HeroesForge.
 *
 * HeroesForge is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * HeroesForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HeroesForge.  If not, see <http://www.gnu.org/licenses/>.
 *************************************************************************/
package org.diskordia.heroesforge.client.preferences;

import java.util.prefs.Preferences;

/**
 * The default @see org.diskordia.heroesforge.client.preferences.IClientPreferences implementation,
 * to store the heroes forge client settings. Uses the standard java preferences.
 * 
 * @author FSuite
 */
public class DefaultPreferences implements IClientPreferences{
	private final static String PREFERENCES_NODE = "HeroesForge";
	
	private Preferences preferences = Preferences.userRoot().node(PREFERENCES_NODE);
	private IConnectionInfo serverConnection;
	
	/**
	 * Initializes an instance of the @see DefaultPreferences class.
	 */
	public DefaultPreferences()
	{
		this.serverConnection = new DefaultConnectionInfo(this.preferences);
	}
	
	/* (non-Javadoc)
	 * @see org.diskordia.heroesforge.client.preferences.IClientPreferences#getServerConnection()
	 */
	@Override
	public IConnectionInfo getServerConnection() {
		return this.serverConnection;
	}

}
